<template>
  <div class="link-status">
    <div class="cloud-icon"></div>
    <ul class="status">
      <li class="video-system all-link">视频监控系统</li>
      <li class="transport-system all-link">运输系统</li>
      <li class="ventilate-wind-system all-link">通风系统</li>
      <li class="compresse-wind-system all-link">压风系统</li>
      <li class="water-system all-link">排水系统</li>
      <li class="elec-system all-link">供配电系统</li>
    </ul>
    <ul class="legend">
      <i class="el-tooltip el-icon-question item"></i>
      <li class="all-link">连接</li>
      <li class="discon-link">断开</li>
    </ul>
  </div>
</template>

<script>
export default {
  mounted() {
    // 可以在这里添加动画控制逻辑（如果需要）
  }
}
</script>

<style lang="scss" scoped>
$link-color: #4a90e2;
$link-highlight: #00f7ff;
$animation-duration: 2.5s;

.link-status {
  position: relative;

  .cloud-icon {
    z-index: 9;
    position: absolute;
    top: 20px;
    left: 340px;
    width: 299px;
    height: 224px;
    background: url(./img/cloud-icon.png) 0 0 no-repeat;
    background-size: 100%;
    animation: float 3s ease-in-out infinite;

    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }
  }

  .status {
    width: 100%;
    height: 550px;
    position: relative;

    li {
      width: 98px;
      height: 100px;
      padding-top: 95px;
      color: #c4e3ff;
      font-size: 16px;
      text-align: center;
      list-style: none;
      position: absolute;
      background-size: 100%;
      background-repeat: no-repeat;
      background-position: top;
      transition: all 0.3s ease;

      &:hover {
        color: #fff;
        text-shadow: 0 0 10px $link-highlight;
      }

      &.all-link {
        &:before {
          content: "";
          position: absolute;
          top: -20px;
          left: 50%;
          transform: translateX(-50%);
          width: 2px;
          height: 20px;
          background: linear-gradient(to bottom, transparent, $link-highlight);
          z-index: -1;
        }

        &:after {
          content: "";
          position: absolute;
          top: -20px;
          left: 50%;
          transform: translateX(-50%);
          width: 150px;
          height: 150px;
          border-radius: 50%;
          z-index: -2;
          opacity: 0.1;
          box-shadow: 0 0 30px 10px rgba($link-highlight, 0.5);
          animation: pulse 3s infinite;
        }
      }
    }

    .video-system {
      top: 50px;
      left: 100px;
      background-image: url(./img/video-icon.png);

      &.all-link:after {
        background: linear-gradient(
          90deg,
          transparent 0%,
          $link-color 30%,
          $link-highlight 50%,
          $link-color 70%,
          transparent 100%
        );
        background-size: 200% 100%;
        width: 200px;
        height: 3px;
        top: -10px;
        left: -50px;
        transform: translateX(0);
        border-radius: 0;
        box-shadow: none;
        animation: linkFlow $animation-duration linear infinite;
      }
    }

  }

  .legend {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-top: 20px;

    li {
      display: inline-block;
      margin: 0 15px;
      padding: 5px 15px;
      border-radius: 15px;
      font-size: 14px;

      &.all-link {
        background: linear-gradient(90deg, $link-color, $link-highlight);
        color: #0c2461;
        animation: pulse 2s infinite;
      }

      &.discon-link {
        background: linear-gradient(90deg, #ff6b6b, #ffa502);
        color: white;
      }
    }

    .el-icon-question {
      margin-right: 15px;
      color: $link-highlight;
      font-size: 18px;
      cursor: pointer;
    }
  }
}

@keyframes linkFlow {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}
</style>
